<template>
    <div>
        <!-- 轮播图 -->
        <div  class="carousel">
            <el-carousel height="38vw" trigger="click">
                <el-carousel-item v-for="item in img" :key="item.id">
                    <router-link to="">
                        <img :src="item.s_photos[0].path" alt="" class="img" ref="bannerHeight">
                    </router-link>
                </el-carousel-item>
            </el-carousel>
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            img:[],
        }
    },
    methods: {
        
    },
    created() {
        this.$http({
            method:'GET',
            url:'http://shop.0melon0.cn/api/carousel',
            params:{
                project_id: 18
            }
        }).then(data => {
            // console.log(data)
            this.img = data
        })
    },
}
</script>

<style lang="scss" scoped>
    .carousel {
        img {
            width: 100%;
        }
    }
</style>